#pragma once

namespace esphome {
  namespace mcquay_vrf {
    class McquayVrfClimate; // Forward declaration
  }
}
#include "mcquay_vrf_climate.h"

#include "esphome.h"
#include "esphome/core/component.h"
#include "esphome/components/uart/uart.h"
#include "esphome/components/climate/climate.h"


#define TAG "mcquay.vrf"

namespace esphome {
  namespace mcquay_vrf {
    class McquayVrfComponent : public PollingComponent, public uart::UARTDevice {
    public:
      McquayVrfComponent(uart::UARTComponent *uartComponent) : PollingComponent(2000), UARTDevice(uartComponent) {
        this->uart_ = uartComponent;
      };
      void setup() override;
      void update() override;
      void loop() override;
      void register_climate(mcquay_vrf::McquayVrfClimate *obj) {
        this->climates_.push_back(obj);
      }
      uart::UARTComponent* get_uart() {
        return this->uart_;
      }
    protected:
      uart::UARTComponent* uart_;
      std::vector<mcquay_vrf::McquayVrfClimate *> climates_;
      uint8_t update_pos_;
    };
  }
}
